home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / source / libq / IIpb_prime.c < prev    next >
Encoding:
C/C++ Source or Header  |  1985-01-23  |  1.0 KB  |  54 lines

  1. # include    <pipes.h>
  2. # include    <symbol.h>
  3. # include    <sccs.h>
  4.  
  5. SCCSID(@(#)IIpb_prime.c    8.1    12/31/84)
  6.  
  7.  
  8. /*
  9. **  IIPB_PRIME -- prime a pipe for reading or writing
  10. **
  11. **    This clears out any nasty stuff in the pipe block.  If
  12. **    we are reading, it reads the first block so that we can
  13. **    know what sort it is.
  14. **
  15. **    Parameters:
  16. **        ppb -- a pointer to the pipe block.
  17. **        type -- if PB_NOTYPE, we are setting for reading.
  18. **            Otherwise, we are setting to write a
  19. **            message of the indicated type.
  20. **
  21. **    Returns:
  22. **        none
  23. **
  24. **    Side Effects:
  25. **        Changes *ppb.
  26. **
  27. **    Trace Flags:
  28. **        12.0
  29. */
  30.  
  31. IIpb_prime(ppb, type)
  32. register pb_t    *ppb;
  33. int        type;
  34. {
  35.     if (type == PB_NOTYPE)
  36.     {
  37.         /* read pipe prime -- get the first block */
  38.         IIpb_read(ppb);
  39.     }
  40.     else
  41.     {
  42.         /* write pipe prime -- set up initial pointers */
  43.         ppb->pb_from = ppb->pb_resp = PB_FRONT;
  44.         ppb->pb_type = type;
  45.         ppb->pb_stat = 0;
  46.         ppb->pb_nleft = PB_DBSIZE;
  47.         ppb->pb_nused = 0;
  48.         ppb->pb_st = mdPARSER;
  49.     }
  50.  
  51.     /* do common initialization */
  52.     ppb->pb_xptr = ppb->pb_data;
  53. }
  54.